package org.zxxxt.shortlink.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.zxxxt.shortlink.admin.dao.entity.UserDO;
import org.zxxxt.shortlink.admin.dto.req.UserLoginReqDTO;
import org.zxxxt.shortlink.admin.dto.req.UserRegisterReqDTO;
import org.zxxxt.shortlink.admin.dto.req.UserUpdateReqDTO;
import org.zxxxt.shortlink.admin.dto.resp.UserLoginRespDTO;
import org.zxxxt.shortlink.admin.dto.resp.UserRespDTO;

public interface UserService extends IService<UserDO> {

    /**
     * 根据用户名查询
     */
    UserRespDTO getUserByUsername(String username);

    /**
     *  查询用户名是否存在
     */
    Boolean hasUsername(String username);

    /**
     * 用户注册
     */
    void register(UserRegisterReqDTO requestParam);


    /**
     * 根据用户名修改用户
     */
    void update(UserUpdateReqDTO requestParam);


    /**
     * 用户登录
     */
    UserLoginRespDTO login(UserLoginReqDTO requestParam);


    /**
     * 检查用户是否登录
     */
    Boolean checkLogin(String username,String token);


    /**
     * 退出登录
     */
    void logout(String username, String token);
}
